#pragma once

#include <AVUIAnimatable.h>

namespace AVUI {

class Brush;
class Pen : public Animatable
{
public:
    Pen() : m_width(1.0f), m_pBrush(NULL) { }
    ~Pen() { };

    DECLARE_ELEMENT(Pen, Animatable);

    DECLARE_DEPENDENCY_PROPERTY(Brush);
    TRefCountedPtr<Brush> get_Brush() { return m_pBrush; }
    void set_Brush(Brush* pValue) { SetValue(get_BrushProperty(), (Object*)pValue); } 

    DECLARE_DEPENDENCY_PROPERTY(Thickness);
    float get_Thickness() { return AVUI::UnboxValue<float>(GetValue(get_ThicknessProperty())); }
    void set_Thickness(float value) { SetValue(get_ThicknessProperty(), AVUI::BoxValue(value)); } 

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<Pen>().get_Ptr(); }

private:
    static void StaticConstructor();

    static void BrushPropertyChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e);

    float m_width;
    Brush* m_pBrush;
};


typedef TRefCountedPtr<Pen> PenPtr;

}; // namespace AVUI
